Optimal. Leaf size=229 \[ 4 a^3 A b x+\frac {\left (8 a^4 C+24 a^2 b^2 (2 A+C)+b^4 (4 A+3 C)\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {A (a+b \sec (c+d x))^4 \sin (c+d x)}{d}-\frac {a b \left (a^2 (12 A-19 C)-8 b^2 (3 A+2 C)\right ) \tan (c+d x)}{6 d}-\frac {b^2 \left (a^2 (24 A-26 C)-3 b^2 (4 A+3 C)\right ) \sec (c+d x) \tan (c+d x)}{24 d}-\frac {a b (12 A-7 C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}-\frac {b (4 A-C) (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.34, antiderivative size = 229, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 6, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {4180, 4141,
4133, 3855, 3852, 8} \begin {gather*} 4 a^3 A b x-\frac {a b \left (a^2 (12 A-19 C)-8 b^2 (3 A+2 C)\right ) \tan (c+d x)}{6 d}-\frac {b^2 \left (a^2 (24 A-26 C)-3 b^2 (4 A+3 C)\right ) \tan (c+d x) \sec (c+d x)}{24 d}+\frac {\left (8 a^4 C+24 a^2 b^2 (2 A+C)+b^4 (4 A+3 C)\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}-\frac {b (4 A-C) \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}-\frac {a b (12 A-7 C) \tan (c+d x) (a+b \sec (c+d x))^2}{12 d}+\frac {A \sin (c+d x) (a+b \sec (c+d x))^4}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 4133
Rule 4141
Rule 4180
Rubi steps
\begin {align*} \int \cos (c+d x) (a+b \sec (c+d x))^4 \left (A+C \sec ^2(c+d x)\right ) \, dx &=\frac {A (a+b \sec (c+d x))^4 \sin (c+d x)}{d}+\int (a+b \sec (c+d x))^3 \left (4 A b+a C \sec (c+d x)-b (4 A-C) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {A (a+b \sec (c+d x))^4 \sin (c+d x)}{d}-\frac {b (4 A-C) (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {1}{4} \int (a+b \sec (c+d x))^2 \left (16 a A b+\left (4 A b^2+4 a^2 C+3 b^2 C\right ) \sec (c+d x)-a b (12 A-7 C) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {A (a+b \sec (c+d x))^4 \sin (c+d x)}{d}-\frac {a b (12 A-7 C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}-\frac {b (4 A-C) (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {1}{12} \int (a+b \sec (c+d x)) \left (48 a^2 A b+a \left (36 A b^2+12 a^2 C+23 b^2 C\right ) \sec (c+d x)-b \left (a^2 (24 A-26 C)-3 b^2 (4 A+3 C)\right ) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {A (a+b \sec (c+d x))^4 \sin (c+d x)}{d}-\frac {b^2 \left (a^2 (24 A-26 C)-3 b^2 (4 A+3 C)\right ) \sec (c+d x) \tan (c+d x)}{24 d}-\frac {a b (12 A-7 C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}-\frac {b (4 A-C) (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {1}{24} \int \left (96 a^3 A b+3 \left (8 a^4 C+24 a^2 b^2 (2 A+C)+b^4 (4 A+3 C)\right ) \sec (c+d x)-4 a b \left (a^2 (12 A-19 C)-8 b^2 (3 A+2 C)\right ) \sec ^2(c+d x)\right ) \, dx\\ &=4 a^3 A b x+\frac {A (a+b \sec (c+d x))^4 \sin (c+d x)}{d}-\frac {b^2 \left (a^2 (24 A-26 C)-3 b^2 (4 A+3 C)\right ) \sec (c+d x) \tan (c+d x)}{24 d}-\frac {a b (12 A-7 C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}-\frac {b (4 A-C) (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}-\frac {1}{6} \left (a b \left (a^2 (12 A-19 C)-8 b^2 (3 A+2 C)\right )\right ) \int \sec ^2(c+d x) \, dx+\frac {1}{8} \left (8 a^4 C+24 a^2 b^2 (2 A+C)+b^4 (4 A+3 C)\right ) \int \sec (c+d x) \, dx\\ &=4 a^3 A b x+\frac {\left (8 a^4 C+24 a^2 b^2 (2 A+C)+b^4 (4 A+3 C)\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {A (a+b \sec (c+d x))^4 \sin (c+d x)}{d}-\frac {b^2 \left (a^2 (24 A-26 C)-3 b^2 (4 A+3 C)\right ) \sec (c+d x) \tan (c+d x)}{24 d}-\frac {a b (12 A-7 C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}-\frac {b (4 A-C) (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {\left (a b \left (a^2 (12 A-19 C)-8 b^2 (3 A+2 C)\right )\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{6 d}\\ &=4 a^3 A b x+\frac {\left (8 a^4 C+24 a^2 b^2 (2 A+C)+b^4 (4 A+3 C)\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {A (a+b \sec (c+d x))^4 \sin (c+d x)}{d}-\frac {a b \left (a^2 (12 A-19 C)-8 b^2 (3 A+2 C)\right ) \tan (c+d x)}{6 d}-\frac {b^2 \left (a^2 (24 A-26 C)-3 b^2 (4 A+3 C)\right ) \sec (c+d x) \tan (c+d x)}{24 d}-\frac {a b (12 A-7 C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}-\frac {b (4 A-C) (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(1357\) vs. \(2(229)=458\).
time = 6.55, size = 1357, normalized size = 5.93 \begin {gather*} \frac {8 a^3 A b (c+d x) \cos ^6(c+d x) (a+b \sec (c+d x))^4 \left (A+C \sec ^2(c+d x)\right )}{d (b+a \cos (c+d x))^4 (A+2 C+A \cos (2 c+2 d x))}+\frac {\left (-48 a^2 A b^2-4 A b^4-8 a^4 C-24 a^2 b^2 C-3 b^4 C\right ) \cos ^6(c+d x) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) (a+b \sec (c+d x))^4 \left (A+C \sec ^2(c+d x)\right )}{4 d (b+a \cos (c+d x))^4 (A+2 C+A \cos (2 c+2 d x))}+\frac {\left (48 a^2 A b^2+4 A b^4+8 a^4 C+24 a^2 b^2 C+3 b^4 C\right ) \cos ^6(c+d x) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) (a+b \sec (c+d x))^4 \left (A+C \sec ^2(c+d x)\right )}{4 d (b+a \cos (c+d x))^4 (A+2 C+A \cos (2 c+2 d x))}+\frac {b^4 C \cos ^6(c+d x) (a+b \sec (c+d x))^4 \left (A+C \sec ^2(c+d x)\right )}{8 d (b+a \cos (c+d x))^4 (A+2 C+A \cos (2 c+2 d x)) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^4}+\frac {\left (12 A b^4+72 a^2 b^2 C+16 a b^3 C+9 b^4 C\right ) \cos ^6(c+d x) (a+b \sec (c+d x))^4 \left (A+C \sec ^2(c+d x)\right )}{24 d (b+a \cos (c+d x))^4 (A+2 C+A \cos (2 c+2 d x)) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {4 a b^3 C \cos ^6(c+d x) (a+b \sec (c+d x))^4 \left (A+C \sec ^2(c+d x)\right ) \sin \left (\frac {1}{2} (c+d x)\right )}{3 d (b+a \cos (c+d x))^4 (A+2 C+A \cos (2 c+2 d x)) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^3}-\frac {b^4 C \cos ^6(c+d x) (a+b \sec (c+d x))^4 \left (A+C \sec ^2(c+d x)\right )}{8 d (b+a \cos (c+d x))^4 (A+2 C+A \cos (2 c+2 d x)) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^4}+\frac {4 a b^3 C \cos ^6(c+d x) (a+b \sec (c+d x))^4 \left (A+C \sec ^2(c+d x)\right ) \sin \left (\frac {1}{2} (c+d x)\right )}{3 d (b+a \cos (c+d x))^4 (A+2 C+A \cos (2 c+2 d x)) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^3}+\frac {\left (-12 A b^4-72 a^2 b^2 C-16 a b^3 C-9 b^4 C\right ) \cos ^6(c+d x) (a+b \sec (c+d x))^4 \left (A+C \sec ^2(c+d x)\right )}{24 d (b+a \cos (c+d x))^4 (A+2 C+A \cos (2 c+2 d x)) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {8 \cos ^6(c+d x) (a+b \sec (c+d x))^4 \left (A+C \sec ^2(c+d x)\right ) \left (3 a A b^3 \sin \left (\frac {1}{2} (c+d x)\right )+3 a^3 b C \sin \left (\frac {1}{2} (c+d x)\right )+2 a b^3 C \sin \left (\frac {1}{2} (c+d x)\right )\right )}{3 d (b+a \cos (c+d x))^4 (A+2 C+A \cos (2 c+2 d x)) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}+\frac {8 \cos ^6(c+d x) (a+b \sec (c+d x))^4 \left (A+C \sec ^2(c+d x)\right ) \left (3 a A b^3 \sin \left (\frac {1}{2} (c+d x)\right )+3 a^3 b C \sin \left (\frac {1}{2} (c+d x)\right )+2 a b^3 C \sin \left (\frac {1}{2} (c+d x)\right )\right )}{3 d (b+a \cos (c+d x))^4 (A+2 C+A \cos (2 c+2 d x)) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}+\frac {2 a^4 A \cos ^6(c+d x) (a+b \sec (c+d x))^4 \left (A+C \sec ^2(c+d x)\right ) \sin (c+d x)}{d (b+a \cos (c+d x))^4 (A+2 C+A \cos (2 c+2 d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.16, size = 247, normalized size = 1.08 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.30, size = 306, normalized size = 1.34 \begin {gather*} \frac {192 \, {\left (d x + c\right )} A a^{3} b + 64 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a b^{3} - 3 \, C b^{4} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 72 \, C a^{2} b^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, A b^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 24 \, C a^{4} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 144 \, A a^{2} b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 48 \, A a^{4} \sin \left (d x + c\right ) + 192 \, C a^{3} b \tan \left (d x + c\right ) + 192 \, A a b^{3} \tan \left (d x + c\right )}{48 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.08, size = 236, normalized size = 1.03 \begin {gather*} \frac {192 \, A a^{3} b d x \cos \left (d x + c\right )^{4} + 3 \, {\left (8 \, C a^{4} + 24 \, {\left (2 \, A + C\right )} a^{2} b^{2} + {\left (4 \, A + 3 \, C\right )} b^{4}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (8 \, C a^{4} + 24 \, {\left (2 \, A + C\right )} a^{2} b^{2} + {\left (4 \, A + 3 \, C\right )} b^{4}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (24 \, A a^{4} \cos \left (d x + c\right )^{4} + 32 \, C a b^{3} \cos \left (d x + c\right ) + 6 \, C b^{4} + 32 \, {\left (3 \, C a^{3} b + {\left (3 \, A + 2 \, C\right )} a b^{3}\right )} \cos \left (d x + c\right )^{3} + 3 \, {\left (24 \, C a^{2} b^{2} + {\left (4 \, A + 3 \, C\right )} b^{4}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 590 vs.
\(2 (220) = 440\).
time = 0.54, size = 590, normalized size = 2.58 \begin {gather*} \frac {96 \, {\left (d x + c\right )} A a^{3} b + \frac {48 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1} + 3 \, {\left (8 \, C a^{4} + 48 \, A a^{2} b^{2} + 24 \, C a^{2} b^{2} + 4 \, A b^{4} + 3 \, C b^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (8 \, C a^{4} + 48 \, A a^{2} b^{2} + 24 \, C a^{2} b^{2} + 4 \, A b^{4} + 3 \, C b^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (96 \, C a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 72 \, C a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 96 \, A a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 96 \, C a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 12 \, A b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 15 \, C b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 288 \, C a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 72 \, C a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 288 \, A a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 160 \, C a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, A b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 9 \, C b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 288 \, C a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 72 \, C a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 288 \, A a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 160 \, C a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, A b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 9 \, C b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 96 \, C a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 72 \, C a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 96 \, A a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 96 \, C a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 12 \, A b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 15 \, C b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.55, size = 1988, normalized size = 8.68 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________